﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Layouts/Form.Master" CodeBehind="DeliveredEdit.aspx.cs" Inherits="Bingosoft.WebApp.Modules.DeliveredManager.DeliveredEdit" %>

<asp:Content ContentPlaceHolderID="head" ID="idFormTitle" runat="server">
    <title><%=Request["title"]%></title>
     <script src="Script/Delivered.js"></script>
</asp:Content>
<asp:Content ContentPlaceHolderID="Content" ID="idFormMain" runat="server">
    <web:SmartFormView ID="SmartFormView1" runat="server" DataKeyNames="Id" DataSourceID="SmartDataSource1"
        Width="100%">        
        <InsertItemTemplate></InsertItemTemplate>
        <EditItemTemplate></EditItemTemplate>
        <ItemTemplate>
            
          <div>
            <table cellpadding='2' cellspacing='1' width='100%' class="formitem">
             <caption><%=Request["title"]%></caption>
                <tr>
                    <th>                        
                        物资编号:<font color='red'>*<font>
                    </th>
                    <td>
                         <asp:TextBox ID='txtMaterialsNo' Name='MaterialsNo' runat='server' Text='<%# Bind("MaterialsNo") %>' Width='90%' MaxLength="30"
                            validator="required,length[1,50]"></asp:TextBox>  
                  <%--       <asp:TextBox ID='txtForeignD' style="display:none" Name='ForeignD' runat='server' Width='10' MaxLength="30"
                            validator="length[1,50]" ></asp:TextBox>  --%>                        
                         <asp:TextBox ID='txtType' Name='Type' style="display:none" runat='server' Width='10' MaxLength="30"
                            validator="length[1,50]"></asp:TextBox>   
                         <%--出库ID--%>
                         <asp:TextBox ID='txtID' Name='d_ID' style="display:none" runat='server' Width='10' MaxLength="30"
                            validator="length[1,50]"></asp:TextBox> 
                       
                        <asp:TextBox ID='ID' Visible="false" runat='server' Text='<%# Bind("ID") %>' Width='10' MaxLength="30"
                            validator="length[1,50]"></asp:TextBox> 
                    </td>
                    <th>
                        物资名称:<font color='red'>*<font>
                    </th>
                    <td>
                        <asp:TextBox ID='txtMaterialsName' Name='MaterialsName' runat='server' Text='<%# Bind("MaterialsName") %>' Width='90%' MaxLength="20"
                            validator="required,length[1,100]"></asp:TextBox>
                    </td>
                    <th>                        
                        物资规格（型号）:
                    </th>
                    <td>
                        <asp:TextBox ID='txtMaterialsModel' Name='MaterialsModel' runat='server' Text='<%# Bind("MaterialsModel") %>' Width='90%' MaxLength="20"
                            validator="length[1,100]"></asp:TextBox>
                    </td>
                </tr>    
                 <tr> 
                     <th>                        
                        出库数量:<font color='red'>*<font>
                    </th>
                    <td>
                         <asp:TextBox ID='txtDeliveredNum' runat='server' Name='DeliveredNum' Text='<%# Bind("DeliveredNum") %>' Width='90%' MaxLength="30"
                            validator="required,double,length[1,50]"></asp:TextBox>                        
                    </td>
                    <th>                        
                        计量单位:
                    </th>
                    <td>
                         <asp:TextBox ID='txtUnit' runat='server' Name='Unit' Text='<%# Bind("Unit") %>' Width='90%' MaxLength="30"
                            validator="length[1,50]"></asp:TextBox>                        
                    </td>
                    <th>
                        单价(元):<font color='red'>*<font>
                    </th>
                    <td>
                        <asp:TextBox ID='txtPrice' runat='server' Name='Price' Text='<%# Bind("Price") %>' Width='90%' MaxLength="20"
                            validator="required,double,length[1,100]"></asp:TextBox>
                    </td>
                </tr>     
                <tr>
                    <th>                        
                        总金额:
                    </th>
                    <td>
                        <asp:TextBox ID='txtAmount' runat='server' Name='Amount' Text='<%# Bind("Amount") %>' Width='90%' MaxLength="20"
                            validator="required,double,length[1,100]"></asp:TextBox>
                    </td>
                    <th>                        
                        领料人:<font color='red'>*<font>
                    </th>
                    <td>
                         <asp:TextBox ID='txtPickingor' runat='server' Name='Pickingor' Text='<%# Bind("Pickingor") %>' Width='90%' MaxLength="30"
                            validator="required,length[1,50]"></asp:TextBox>                        
                    </td>
                    <th>
                        班组:<font color='red'>*<font>
                    </th>
                    <td>
                    <web:SmartDropDownList ID="dpTeam" Name="Team"  DataValueField='<%Team%>' runat="server" CssClass="txtSelect" CommandName="SELECT Name,Name FROM dbo.SEC_Organization WHERE Parent='F4AA63F9-2232-42BF-9247-56F1A55847F0'" />
                      <%--  <asp:TextBox ID='txtTeam' runat='server' Name='Team' Text='<%# Bind("Team") %>' Width='90%' MaxLength="20"
                            validator="required,length[1,100]"></asp:TextBox>--%>
                    </td>
                </tr>  
                <tr>
                    <th>                        
                        机车号:
                    </th>
                    <td>
                     
                        <asp:TextBox ID='txtLocomotiveNo' runat='server' Name='LocomotiveNo' Text='<%# Bind("LocomotiveNo") %>' Width='90%' MaxLength="20"
                            validator="length[1,100]"></asp:TextBox>
                    </td>
                    <th>                        
                        机车修程:
                    </th>
                    <td>
                    <web:SmartDropDownList ID="dpRepairProcess" Name="RepairProcess" runat="server"  DictionaryCode="RepairLevel" CssClass="txtSelect" />
                    <%--     <asp:TextBox ID='txtRepairProcess' runat='server' Name='RepairProcess' Text='<%# Bind("RepairProcess") %>' Width='90%' MaxLength="30"
                            validator="length[1,50]"></asp:TextBox>   --%>                     
                    </td>
                    <th>
                        发料人:
                    </th>
                    <td>
                        <asp:TextBox ID='txtSender' runat='server' Name='Creator' Text='<%# Bind("Sender") %>' Width='90%' MaxLength="20"
                            validator="length[1,100]"></asp:TextBox>
                    </td>
                </tr>   
                <tr>
                 <th>
                        是否交旧:
                    </th>
                    <td>
                        <web:SmartDropDownList ID="dropIsOld" Name="IsOld" runat="server"  DictionaryCode="YesOrNo" CssClass="txtSelect" />
                    </td>
                    <th>出库时间:</th>
                    <td> <web:DatePicker ID="dpSubmitDt" Name="SubmitDt" runat="server" Text='<%# Bind("SubmitDt") %>' DateTimeFormat="yyyy-MM-dd" ></web:DatePicker></td>
                      <th>架子:</th>
                       <td>
                        <asp:TextBox ID='txtFrame' runat='server' Name='Frame' Text='<%# Bind("Frame") %>' Width='90%' MaxLength="20"
                            validator="length[1,200]"></asp:TextBox>
                    </td>
                </tr>
                <tr>      
                    <th>层:</th>
                       <td>
                        <asp:TextBox ID='txtLevel' runat='server' Name='Level' Text='<%# Bind("Level") %>' Width='90%' MaxLength="20"
                            validator="length[1,200]"></asp:TextBox>
                    </td>
                </tr>               
            </table>
        </div>
        </ItemTemplate>
    </web:SmartFormView>
    
    <web:SmartSqlDataSource ID="SmartDataSource1" runat="server" SelectCommand="Delivered.select"
     SelectCommandAutoPageWrap="false" InsertCommand="Delivered.insert" UpdateCommand="Delivered.update">
    </web:SmartSqlDataSource>

    <!-- 页脚区域 -->
	<div class="footer">
		<asp:Button runat="server" Text="确定" 
            OnClientClick="return validateForm();" onclick="Save"/>        
        <asp:Button ID="CloseButton2" runat="server" Text="关闭" OnClientClick="return closeForm();" />        
	</div>
    
     <script type="text/javascript">
         $(function () {
             if ($("input[id$='txtType']") != null)
                 $("input[id$='txtType']").val('<%=this.Type %>');
             if ($("input[id$='txtID']") != null)
                 $("input[id$='txtID']").val('<%=this.d_ID %>');
             if ($("input[id$='ID']") != null)
                 $("input[id$='ID']").val('<%=this.d_ID %>');
             if ('<%=this.d_ID %>' == '') {
                 if ($("input[id$='txtMaterialsNo']") != null)
                     $("input[id$='txtMaterialsNo']").val('<%=this.m_txtMaterialsNo %>');
                 if ($("input[id$='txtMaterialsName']") != null)
                     $("input[id$='txtMaterialsName']").val('<%=this.m_txtMaterialsName %>');
                 if ($("input[id$='txtMaterialsModel']") != null)
                     $("input[id$='txtMaterialsModel']").val('<%=this.m_txtMaterialsModel %>');
                 if ($("input[id$='txtPrice']") != null)
                     $("input[id$='txtPrice']").val('<%=this.m_txtPrice %>');
                 
             }

         }
         )

     </script>
</asp:Content>
